<%@ Page Language="C#"  MasterPageFile="Master.master" AutoEventWireup="true" CodeFile="Questionaire.aspx.cs" Inherits="Questionaire" %>
<%@ MasterType VirtualPath="~/Master.master" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

    <h1><asp:Literal ID="litQuestionnaire" runat="server"></asp:Literal></h1>

    <asp:Repeater ID="rptQuestions"  runat="server" OnItemDataBound="rptQuestions_ItemDataBound" OnItemCommand="rptQuestions_ItemCommand" OnItemCreated="rptQuestions_ItemCreated" >

        <ItemTemplate>

            <asp:HiddenField ID="hdfQuestionID" runat="server" Value='<%# Eval("QuestionID") %>'></asp:HiddenField>
            <asp:HiddenField ID="hdfQuestionType_FK" runat="server" Value='<%# Eval("QuestionType_FK") %>'></asp:HiddenField>

            <div class="formInputTitle"><%# Eval("Question") %></div>

                <asp:PlaceHolder ID="plhOptions" EnableViewState="true" runat="server"></asp:PlaceHolder>
                
                <asp:CheckBoxList ID="chkbList"  Visible="false" runat="server" CssClass="checkBoxList"></asp:CheckBoxList>
                
                <p><asp:Literal ID="litLowerText" runat="server" Visible="false"></asp:Literal>
                <asp:RadioButtonList ID="rdbList" Visible="false" runat="server">
                    <asp:ListItem Text="1" Value="1"></asp:ListItem>
                    <asp:ListItem Text="2" Value="2"></asp:ListItem>
                    <asp:ListItem Text="3" Value="3"></asp:ListItem>
                    <asp:ListItem Text="4" Value="4"></asp:ListItem>
                    <asp:ListItem Text="5" Value="5"></asp:ListItem>
                </asp:RadioButtonList>
                <asp:RequiredFieldValidator  ID="RequiredFieldValidator1"  ValidationGroup="questionnaire" ControlToValidate="rdbList" SetFocusOnError="true" runat="server" ErrorMessage="*"></asp:RequiredFieldValidator>
                <asp:Literal ID="litUpperText" runat="server" Visible="false"></asp:Literal>
                </p>
                <asp:TextBox ID="txtBox" TextMode="MultiLine" Columns="50" runat="server" Visible="false"></asp:TextBox>
                <asp:RequiredFieldValidator ID="rqfTextBox"  ValidationGroup="questionnaire"  Enabled="false" ControlToValidate="txtBox" SetFocusOnError="true" runat="server" ErrorMessage="*"></asp:RequiredFieldValidator>

        </ItemTemplate>

    </asp:Repeater>
    
    <p><asp:Button ID="btnSubmit" CommandName="Next"  ValidationGroup="questionnaire" runat="server" Text="Next" OnClick="btnSubmit_Click" />

</asp:Content>